PRGE Outcome Measures

Column

Column

PRGE Repeated Meausures

Column

Column

FALO Outcome Measures

Column

Column

DRKAT Outcome Measures

Column

Column

Client Demographics

Column

Client Demographics
Client Sex Age Prior Concussions History of Depression/Anxiety
PRGE Female 16 3 No
FALO Male 18 4 No
DRKAT Female 19 4 No
---
title: "Client Pilot Data Spring 2020"
output: 
  flexdashboard::flex_dashboard:
    orientation: columns
    social: menu
    source_code: embed
    vertical_layout: scroll
    theme: cerulean
---

```{r setup, include=FALSE}
library(flexdashboard)
library(tidyverse)
library(rio)
library(here)
library(colorblindr)
library(gghighlight)
library(forcats)
library(ggrepel)
library(gt)
library(knitr)
library(kableExtra)
library(reactable)
library(plotly)
library(patchwork)

opts_chunk$set(echo = FALSE,
               fig.width = 5,
               fig.height = 6)

theme_set(theme_minimal(base_size = 8))

outcome <- import(here("data", "client_data_outcome.sav"),
               setclass = "tbl_df") %>% 
  characterize() %>% 
  janitor::clean_names() 

rm_prge <- import(here("data", "repeated_measures_prge.sav"),
               setclass = "tbl_df") %>% 
  characterize() %>% 
  janitor::clean_names() 

head(outcome)
head(rm_prge)


```

# PRGE Outcome Measures

Column {data-width=650}
-----------------------------------------------------------------------

```{r outcome measures data organization, include=FALSE}
head(outcome)

outcome_tidy <- outcome %>% 
  select(1:15) %>% 
  rename("PCSS Pre Score" = pcss_pre,
         "PCSS Post Score" = pcss_post,
         "HIT Pre Score" = hit_pre,
         "HIT Post Score" = hit_post,
         "CLASS Pre Score" = class_total_pre,
         "CLASS Post Score" = class_total_post,
         "BRIEF SR Pre Score" = brief_pre_self,
         "BRIEF Parent Pre Score" = brief_pre_inf,
         "BRIEF SR Post Score" = brief_post_self,
         "BRIEF Parent Post Score" = brief_post_inf) %>% 
  pivot_longer(
    cols = c(6:15),
    names_to = "measure",
    values_to = "score"
  )

ggplot(outcome_tidy, aes(measure, score)) +
  geom_col() +
  coord_flip()

head(outcome)

brief <- outcome %>% 
  filter(client == "PRGE") %>% 
  select(client, brief_pre_self, brief_post_self, brief_pre_inf, brief_post_inf)

brief_tidy <- brief %>% 
  rename("Self Report Pre" = brief_pre_self,
         "Self Report Post" = brief_post_self,
         "Parent Report Pre" = brief_pre_inf,
         "Parent Report Post" = brief_post_inf) %>% 
  pivot_longer(
    cols = c(2:5),
    names_to = "measure",
    values_to = "score"
  )

class <- outcome %>% 
  filter(client == "PRGE") %>% 
  select(client, class_total_pre, class_total_post) %>% 
  rename("Pre Score" = class_total_pre,
         "Post Score" = class_total_post)

class_tidy <- class %>% 
   pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )

symptoms <- outcome %>% 
  filter(client == "PRGE") %>% 
  select(client, pcss_pre, pcss_post) %>% 
  rename("Pre Score" = pcss_pre,
         "Post Score" = pcss_post) %>% 
  pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )

hit <- outcome %>% 
  filter(client == "PRGE") %>% 
  select(client, hit_pre, hit_post) %>% 
  rename("Pre Score" = hit_pre,
         "Post Score" = hit_post) %>% 
   pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )
```

```{r outcome plots, include=FALSE}
#geom_rect(aes(xmin = -Inf, xmax = Inf, ymin = 65, ymax = 100),
            #fill = "lightgreen") + #insert before geom_col 

brief_positions <- c("Self Report Pre", 
                     "Self Report Post", 
                     "Parent Report Pre ", 
                     "Parent Report Post") 

brief_solo <- c("Self Report Pre", 
                "Self Report Post")

class_positions <- c("Pre Score", "Post Score")

pcss_positions <- c("Pre Score", "Post Score")

hit_positions <- c("Pre Score", "Post Score")

p1 <- ggplot(brief_tidy, aes(measure, score)) +
  geom_hline(yintercept = 65, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = brief_positions) +
  scale_y_continuous(limits = c(0, 100),
                     breaks = c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)) +
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "T-score",
       title = "BRIEF Scores",
       caption = "T-scores Above 65 are Clinically Significant") 

p1

p2 <- ggplot(class_tidy, aes(measure, score)) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = class_positions) +
  scale_y_continuous(limits = c(0, 60),
                     breaks = c(10, 20, 30, 40, 50, 60)) +
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "CLASS Scores") 
 p2


p3 <- ggplot(symptoms, aes(measure, score)) +
  geom_hline(yintercept = 30, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = pcss_positions) +
  scale_y_continuous(limits = c(0, 140),
                     breaks = c(20, 40, 60, 80, 100, 120, 140)) + 
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "PCSS Results",
       caption = "Scores Greater than 30 Suggest Symptoms Impact Daily Functioning") 

p3

p3a <- ggplot(hit, aes(measure, score)) +
  geom_hline(yintercept = 50, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = hit_positions) +
  scale_y_continuous(limits = c(0, 60),
                     breaks = c(10, 20, 30, 40, 50, 60)) + 
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "HIT Results",
       caption = "Scores of 50 or Greater Suggest Headaches Impact Daily Functioning") 

p3a
```


```{r prge brief, include=TRUE, fig.width=6}
p1

```

```{r prge class, include=TRUE, fig.width=6}
p2
```

Column {data-width=350}
-----------------------------------------------------------------------

```{r prge pcss, include=TRUE}
p3
```

```{r prge hit, include=TRUE}
p3a
```

# PRGE Repeated Meausures 
Column {data-width=650}
-----------------------------------------------------------------------

```{r repeated measures data cleaning, include=FALSE}

head(rm_prge)

track <- rm_prge %>% 
  select(session, status)

p4 <- ggplot(track, aes(session, status)) +
  geom_line() +
  geom_point(size = 2) +
  scale_x_continuous(limits = c(0, 10),
                     breaks = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) +
  scale_y_continuous(limits = c(0, 6),
                     breaks = c(1, 2, 3, 4, 5, 6)) +
  theme_classic() +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10)) +
  labs(x = "Session",
       y = "Number of Times Required to Reread Content",
       title = "Status Tracking Goal") 

p4


effort_data <- rm_prge %>% 
  select(session, effort)

p5 <- ggplot(effort_data, aes(session, effort)) +
  geom_line() +
  geom_point(size = 2) +
  scale_x_continuous(limits = c(0, 10),
                     breaks = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) +
  scale_y_continuous(limits = c(0, 4),
                     breaks = c(1, 2, 3, 4)) +
  theme_classic() +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10)) +
  labs(x = "Session",
       y = "Perceived Effort During Reading",
       title = "Perceived Effort While Reading",
       caption = "1 = No Effort at All\n 2 = Not Much Effort\n 3 = Some Effort\n 4 = A Lot of Effort") 

p5

helpfulness <- rm_prge %>% 
  select(session, help)

p6 <- ggplot(helpfulness, aes(session, help)) +
  geom_line() +
  geom_point(size = 2) +
  scale_x_continuous(limits = c(0, 10),
                     breaks = c(1, 2, 3, 4, 5, 6, 7, 8, 9, 10)) +
  scale_y_continuous(limits = c(0, 5),
                     breaks = c(1, 2, 3, 4, 5)) +
  theme_classic() +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10)) +
  labs(x = "Session",
       y = "Perceived Helpfulness",
       title = "Perceived Helpfulness of Reading Strategies",
       caption = "1 = Not Helpful at All\n 2 = Not Helpful\n 3 = Somewhat Helpful\n 4 = Helpful\n 5 = Very Helpful") 

p6
```

```{r status, include=TRUE, fig.align="center"}
p4 

```

Column {data-width=350}
-----------------------------------------------------------------------


```{r effort, include=TRUE, fig.align="left"}
p5
```


```{r helpfulness, include=TRUE, fig.align="left"}
p6
```


# FALO Outcome Measures
Column {data-width=650}
-----------------------------------------------------------------------

```{r falo measures data organization, include=FALSE}
head(outcome)

falo <- outcome %>% 
  filter(client == "FALO")

brief_falo <- falo %>% 
  select(client, brief_pre_self, brief_post_self, brief_pre_inf, brief_post_inf) %>% 
  rename("Self Report Pre" = brief_pre_self,
         "Self Report Post" = brief_post_self,
         "Parent Report Pre" = brief_pre_inf,
         "Parent Report Post" = brief_post_inf) %>% 
  pivot_longer(
    cols = c(2:5),
    names_to = "measure",
    values_to = "score"
  )

class_falo <- falo %>% 
  select(client, class_total_pre, class_total_post) %>% 
  rename("Pre Score" = class_total_pre,
         "Post Score" = class_total_post) %>% 
   pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )

pcss_falo <- falo %>% 
  select(client, pcss_pre, pcss_post) %>% 
  rename("Pre Score" = pcss_pre,
         "Post Score" = pcss_post) %>% 
  pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )

hit_falo <- falo %>% 
  select(client, hit_pre, hit_post) %>% 
  rename("Pre Score" = hit_pre,
         "Post Score" = hit_post) %>% 
   pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )
```

```{r falo plots, include=FALSE}

p7 <- ggplot(brief_falo, aes(measure, score)) +
  geom_hline(yintercept = 65, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = brief_positions) +
  scale_y_continuous(limits = c(0, 100),
                     breaks = c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)) +
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "T-score",
       title = "BRIEF Scores",
       caption = "T-scores Above 65 are Clinically Significant") 

p7

p8 <- ggplot(class_falo, aes(measure, score)) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = class_positions) +
  scale_y_continuous(limits = c(0, 60),
                     breaks = c(10, 20, 30, 40, 50, 60)) +
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "CLASS Scores") 
 p8


p9 <- ggplot(pcss_falo, aes(measure, score)) +
  geom_hline(yintercept = 30, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = pcss_positions) +
  scale_y_continuous(limits = c(0, 140),
                     breaks = c(20, 40, 60, 80, 100, 120, 140)) + 
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "PCSS Results",
       caption = "Scores Greater than 30 Suggest Symptoms Impact Daily Functioning") 

p9

p10 <- ggplot(hit_falo, aes(measure, score)) +
  geom_hline(yintercept = 50, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = hit_positions) +
  scale_y_continuous(limits = c(0, 60),
                     breaks = c(10, 20, 30, 40, 50, 60)) + 
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "HIT Results",
       caption = "Scores of 50 or Greater Suggest Headaches Significantly Impact Daily Functioning") 

p10
```


```{r falo brief, include=TRUE, fig.width=6}
p7

```

```{r falo class, include=TRUE, fig.width=6}
p8
```

Column {data-width=350}
-----------------------------------------------------------------------

```{r falo pcss, include=TRUE}
p9
```

```{r falo hit, include=TRUE}
p10
```




# DRKAT Outcome Measures
Column {data-width=650}
-----------------------------------------------------------------------

```{r drkat measures data organization, include=FALSE}
head(outcome)

drkat <- outcome %>% 
  filter(client == "DRKAT")

brief_drkat <- drkat %>% 
  select(client, brief_pre_self, brief_post_self, brief_pre_inf, brief_post_inf) %>% 
  rename("Self Report Pre" = brief_pre_self,
         "Self Report Post" = brief_post_self,
         "Parent Report Pre" = brief_pre_inf,
         "Parent Report Post" = brief_post_inf) %>% 
  pivot_longer(
    cols = c(2:5),
    names_to = "measure",
    values_to = "score"
  )

class_drkat <- drkat %>% 
  select(client, class_total_pre, class_total_post) %>% 
  rename("Pre Score" = class_total_pre,
         "Post Score" = class_total_post) %>% 
   pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )

pcss_drkat <- drkat %>% 
  select(client, pcss_pre, pcss_post) %>% 
  rename("Pre Score" = pcss_pre,
         "Post Score" = pcss_post) %>% 
  pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )

hit_drkat <- drkat %>% 
  select(client, hit_pre, hit_post) %>% 
  rename("Pre Score" = hit_pre,
         "Post Score" = hit_post) %>% 
   pivot_longer(
    cols = c(2:3),
    names_to = "measure",
    values_to = "score"
  )
```

```{r drkat plots, include=FALSE}

drkat_brief_plot <- ggplot(brief_drkat, aes(measure, score)) +
  geom_hline(yintercept = 65, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = brief_solo) +
  scale_y_continuous(limits = c(0, 100),
                     breaks = c(10, 20, 30, 40, 50, 60, 70, 80, 90, 100)) +
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "T-score",
       title = "BRIEF Scores",
       caption = "T-scores Above 65 are Clinically Significant") 

drkat_brief_plot

drkat_class_plot <- ggplot(class_drkat, aes(measure, score)) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = class_positions) +
  scale_y_continuous(limits = c(0, 60),
                     breaks = c(10, 20, 30, 40, 50, 60)) +
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "CLASS Scores") 
 drkat_class_plot


drkat_pcss_plot <- ggplot(pcss_drkat, aes(measure, score)) +
  geom_hline(yintercept = 30, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = pcss_positions) +
  scale_y_continuous(limits = c(0, 140),
                     breaks = c(20, 40, 60, 80, 100, 120, 140)) + 
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "PCSS Results",
       caption = "Scores Greater than 30 Suggest Symptoms Impact Daily Functioning") 

drkat_pcss_plot

drkat_hit_plot <- ggplot(hit_drkat, aes(measure, score)) +
  geom_hline(yintercept = 50, 
             linetype = "dashed",
             size = 1) +
  geom_col(fill = "blue", 
           alpha = 0.7) +
  scale_x_discrete(limits = hit_positions) +
  scale_y_continuous(limits = c(0, 60),
                     breaks = c(10, 20, 30, 40, 50, 60)) + 
  geom_text(aes(measure, score, label = score),
            nudge_y = -3,
            color = "white") +
  theme(panel.grid.major.y = element_blank(),
        panel.grid.minor.x = element_blank(),
        panel.grid.major.x = element_line(color = "gray80")) +
  theme(plot.title = element_text(color = "black", size = 12, face = "bold", hjust = 0.5),
        axis.text = element_text(size = 10),
        axis.title=element_text(size=10),
        strip.text = element_text(size = 10),
        plot.caption = element_text(size = 10)) +
  labs(x = "",
       y = "Score",
       title = "HIT Results",
       caption = "Scores of 50 or Greater Suggest Headaches Significantly Impact Daily Functioning") 

drkat_hit_plot
```


```{r drkat brief, include=TRUE, fig.width=6}
drkat_brief_plot

```

```{r drkat class, include=TRUE, fig.width=6}
drkat_class_plot
```

Column {data-width=350}
-----------------------------------------------------------------------

```{r drkat pcss, include=TRUE}
drkat_pcss_plot
```

```{r drkat hit, include=TRUE}
drkat_hit_plot
```


# Client Demographics
Column {data-width=650}
-----------------------------------------------------------------------

```{r demographic info, include=FALSE}
head(outcome)

demo <- outcome %>% 
  select(1:5) 
head(demo)

demo_table <- demo %>% 
  gt() %>% 
  cols_label(client = "Client",
             sex = "Sex",
             age = "Age",
             prev_mtbi = "Prior Concussions",
             hx_depression = "History of Depression/Anxiety") %>% 
  cols_align(align = "left", columns = vars(client)) %>% 
  cols_align(align = "center", columns = vars(sex, age, prev_mtbi, hx_depression)) %>% 
  tab_header(title = "Client Demographics")
  
demo_table

```

```{r demographic table, include=TRUE, fig.width=6}
demo_table
```